#include <iostream>
#include <math.h>
using namespace std;

typedef long long ll;
const int N = 200010;
ll a[N];

int main() {

    ios::sync_with_stdio(false);
    cin.tie(NULL);

    int n;
    cin >> n;
    for (int i = 1;i <= n;i++) cin >> a[i];

    ll res = 0;
    for (int i = 2;i <= n;i++)
    {
        if (a[i] >= a[i - 1]) continue;

        int t = ceil(log2((double)a[i - 1] / a[i]));
        res += t;

        while (t--) a[i] <<= 1;
    }

    cout << res;

    return 0;
}